<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of NotificationController
 *
 * @author Admin
 */
class Marketing_MynotificationController extends Zend_Controller_Action {

    public function init() {
        /* Initialize action controller here */
    }

    public function preDispatch() {
        $auth = Zend_Auth::getInstance();
        if (!$auth->hasIdentity()) {
            $this->_redirect('/user/login');
        }

        $view = new Zend_View();
        $view->headTitle(' > Marketing > Notifications');
        $this->view->userDetail = $auth->getIdentity();
    }

    public function indexAction() {
        $switchModel = new Application_Model_SwitchModel();
        $paginator = $switchModel->getAllUserAssignedSwitchesForMarketing($this->_request, $this->view->userDetail->id);
        $this->view->paginator = $paginator;
    }

    public function listAction() {
        $this->_helper->layout->disableLayout();
        $switchModel = new Application_Model_SwitchModel();
        $paginator = $switchModel->getAllUserAssignedSwitchesForMarketing($this->_request, $this->view->userDetail->id);
        $this->view->paginator = $paginator;
    }

    public function progressAction() {
        $switchUserDetailModel = new Application_Model_SwitchUserDetailModel();
        $paginator = $switchUserDetailModel->getAllSwitchUserTargets($this->_request, $this->view->userDetail->id);
        $this->view->switchId = $this->_request->getParam('id');
        $this->view->paginator = $paginator;
    }

    public function progresslistAction() {
        $this->_helper->layout->disableLayout();
        $switchUserDetailModel = new Application_Model_SwitchUserDetailModel();
        $paginator = $switchUserDetailModel->getAllSwitchUserTargets($this->_request, $this->view->userDetail->id);
        $this->view->switchId = $this->_request->getParam('id');
        $this->view->paginator = $paginator;
    }

}